﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Mail;

/// <summary>
/// Summary description for SendMail
/// </summary>
public class SendMailHelper
{
    public SendMailHelper()
    {

    }

    public bool Send(string Name, string From, string ToMail, string text)
    {
        try
        {
            SmtpClient SmtpServer = new SmtpClient("localhost");
            // SmtpServer.Port = 465;
            SmtpServer.Credentials = new System.Net.NetworkCredential("Office@revio.ge", "124816");
            //SmtpServer.EnableSsl = true;


            MailMessage mail = new MailMessage();
            mail.From = new MailAddress("Office@revio.ge");
            mail.To.Add(ToMail);
            mail.Subject = Name;
            mail.Body = string.Format("{0}\n,{1}", text, ":From  " + From);


            SmtpServer.Send(mail);

            return true;
        }
        catch (Exception)
        {
            return false;
        }
    }

}

